using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Entity
{
    [System.ComponentModel.DataObject]
    public class TblFavoritesExtended : TblFavorites
    {
        public static List<TblFavorites> GetActiveFavoritesByUserId(int userId)
        {
            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@userId", SqlDbType.Int, 0, ParameterDirection.Input, userId);
            SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_TBL_NEWS_GET_ACTIVE_FAVORITES_BY_USERID);
            GenerateCollectionFromReader reader = new GenerateCollectionFromReader(GenerateTblFavoritesCollectionFromReader);
            List<TblFavorites> objCollection = ((List<TblFavorites>)ExecuteReaderCmd(sqlCmd, reader));
            return objCollection;
        }
        private const string SP_TBL_NEWS_GET_ACTIVE_FAVORITES_BY_USERID = "sp_TblFavorites_Get_Active_Favorites_By_UserId";

    }
}
